package com.pfzy.utildemo.activity.record;

import android.app.Activity;
import android.app.Dialog;
import android.content.Context;

import com.pfzy.utildemo.activity.record.recording.UXDRManager;
import com.pfzy.utildemo.activity.record.recording.UXDriverRecodingParams;
import com.pfzy.utildemo.activity.record.recording.callback.DialogCallBack;
import com.pfzy.utildemo.activity.record.recording.callback.UXDRDialogCallBack;
import com.pfzy.utildemo.activity.record.soundrecord.UxSoundRecordApi;
import com.pfzy.lib.config.log.MyLog;

public class RecordUtils {
    public static Boolean isAAC = true;

    public static void initRecord(Context context) {
        boolean z = true;
        UXDriverRecodingParams uxDriverRecodingParams = new UXDriverRecodingParams()
                .debug(true)
                .baseUrl("www.baidu.com")
                .uid("")
                .dialogCallBack(new UXDRDialogCallBack() {
                    @Override
                    public Dialog getDialog(Activity activity, DialogCallBack dialogCallBack) {
                        return new RecordNormalDialog(activity, dialogCallBack);
                    }
                });
        UXDRManager.getInstance().initParams(context, uxDriverRecodingParams);
        UxSoundRecordApi.switchToAAC(isAAC);
        MyLog.logd("setAcc "+isAAC);
    }

    public static void startRecord(Activity activity) {
        UXDRManager.getInstance().startRecord(activity);
    }

    public static void stopRecord(Activity activity) {
    UXDRManager.getInstance().stopRecord(activity);
    }
}
